<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button class="foo of">hh

    </button>
    <script>
        document.querySelector('.foo').onclick=function(){
            document.querySelector('.foo').classList.toggle('of');
        }
    </script>
</body>
</html>